package fragments.demo;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class FragmentCycleLifeActivity extends Activity {

	/** Fragment生命周期
	 * Fragment -> onAttach()
	 * Fragment -> onCreate()
	 * Fragment -> onCreateView()
	 * HostActivity -> onCreate()
	 * Fragment -> onActivityCreated()
	 * HostActivity -> onStart()
	 * Fragment -> onStart()
	 * HostActivity -> onResume()
	 * Fragment -> onResume()
	 * Fragment -> onPause()
	 * HostActivity -> onPause()
	 * Fragment -> onStop()
	 * HostActivity -> onStop()
	 * Fragment -> onDestroyView()
	 * Fragment -> onDestroy()
	 * Fragment -> onDetach()
	 * HostActivity -> onDestroy()
	 */

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.fragment_cyclelife);
		Log.v("Fragment Cycle", "HostActivity -> onCreate()");
	}
	@Override
	protected void onStart() {
		super.onStart();
		Log.v("Fragment Cycle", "HostActivity -> onStart()");
	}

	@Override
	protected void onRestart() {
		super.onRestart();
		Log.v("Fragment Cycle", "HostActivity -> onRestart()");
	}

	@Override
	protected void onResume() {
		super.onResume();
		Log.v("Fragment Cycle", "HostActivity -> onResume()");
	}

	@Override
	protected void onPause() {
		super.onPause();
		Log.v("Fragment Cycle", "HostActivity -> onPause()");
	}


	@Override
	protected void onStop() {
		super.onStop();
		Log.v("Fragment Cycle", "HostActivity -> onStop()");
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		Log.v("Fragment Cycle", "HostActivity -> onDestroy()");
	}
}
